package _1010.innerfunc;

import java.util.Arrays;
import java.util.Random;
import java.util.function.Supplier;

import org.junit.Test;

public class SupplierDemo {

	/*
	 * public interface Supplier<T>{
	 * 	T get();
	 * }
	 */
	
	@Test
	public void t1() {
		Supplier<Integer> s1 = new Supplier<Integer>() {
			@Override
			public Integer get() {
				return new Random().nextInt(100);
			}
		};
		System.out.println(s1.get());
		
		Supplier<int[]> s2 =  () -> new Random().ints(5).toArray();
		System.out.println(Arrays.toString(s2.get()));
	}
}
